using Common;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AnesSystem.Models
{
    [Serializable()]
    
    public class PatientDrugsModel : BaseModel<PatientDrugsModel>
    {
        private ObjectId _id;
        private string patientID;
        private DrugsModel drugs= new DrugsModel();
        private List<DrugSpeedModel> drugSpeeds = new List<DrugSpeedModel>();
        //private List<ActionModel> actions = new List<ActionModel>();
        private DateTime beginTime;
        private DateTime endTime;
        private DateTime updateTime;
        private string drugReason="";
        private string drugMethod;
        private bool single=false;
        private string type;
        private string status;
        private bool takeOut;
        private string chanel;
        private string liquidType;
        private string totalAmount;
        private string totalAmountUnit = "ml";
        private string takeAmount="";
        private string yongliang;
        private string yongliangUnit;
        private DateTime inputTime;

        
        public string PatientID
        {
            get
            {
                
                return patientID;
            }

            set
            {
                patientID = value;
                RaisePropertyChanged("PatientID");
            }
        }
        public DrugsModel Drugs
        {
            get
            {
               
                return drugs;
            }

            set
            {
                drugs = value;
                RaisePropertyChanged("Drugs");
            }
        }
        public List<DrugSpeedModel> DrugSpeeds
        {
            get
            {
                if (drugSpeeds==null)
                {
                    drugSpeeds = new List<DrugSpeedModel>();
                }
                return drugSpeeds;
            }

            set
            {
                drugSpeeds = value;
                RaisePropertyChanged("DrugSpeeds");
            }
        }
        //public List<ActionModel> Actions
        //{
        //    get
        //    {
        //        return actions;
        //    }

        //    set
        //    {
        //        actions = value;
        //        RaisePropertyChanged("Actions");
        //    }
        //}

        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime BeginTime
        {
            get
            {
                if (beginTime==new DateTime())
                {
                    beginTime = DateTime.Now;
                }
                return beginTime;
            }

            set
            {
                beginTime = value;
                RaisePropertyChanged("BeginTime");
            }
        }
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime EndTime
        {
            get
            {
                return endTime;
            }

            set
            {
                endTime = value;
                RaisePropertyChanged("EndTime");
            }
        }
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime UpdateTime
        {
            get
            {
                return updateTime;
            }

            set
            {
                updateTime = value;
                RaisePropertyChanged("UpdateTime");
            }
        }
        public string DrugReason
        {
            get
            {
                return drugReason;
            }

            set
            {
                drugReason = value;
                RaisePropertyChanged("DrugReason");
            }
        }
        public string DrugMethod
        {
            get
            {
                return drugMethod;
            }

            set
            {
                drugMethod = value;
                RaisePropertyChanged("DrugMethod");
            }
        }
        public bool Single
        {
            get
            {
                return single;
            }

            set
            {
                single = value;
                RaisePropertyChanged("Single");
            }
        }
        public string Type
        {
            get
            {
                return type;
            }

            set
            {
                type = value;
                RaisePropertyChanged("Type");
            }
        }
        public string Status
        {
            get
            {
                return status;
            }

            set
            {
                status = value;
                RaisePropertyChanged("Status");
            }
        }
        public bool TakeOut
        {
            get
            {
                return takeOut;
            }

            set
            {
                takeOut = value;
                RaisePropertyChanged("TakeOut");
            }
        }
        public string Chanel
        {
            get
            {
                return chanel;
            }

            set
            {
                chanel = value;
                RaisePropertyChanged("Chanel");
            }
        }
        public string LiquidType
        {
            get
            {
                return liquidType;
            }

            set
            {
                liquidType = value;
                RaisePropertyChanged("LiquidType");
            }
        }
        public string TotalAmount
        {
            get
            {
                return totalAmount;
            }

            set
            {
                totalAmount = value;
                RaisePropertyChanged("TotalAmount");
            }
        }
        public string TotalAmountUnit
        {
            get
            {
                return totalAmountUnit;
            }

            set
            {
                totalAmountUnit = value;
                RaisePropertyChanged("TotalAmountUnit");
            }
        }
        public string Yongliang
        {
            get
            {
                return yongliang;
            }

            set
            {
                yongliang = value;
                RaisePropertyChanged("Yongliang");
            }
        }
        public string YongliangUnit
        {
            get
            {
                return yongliangUnit;
            }

            set
            {
                yongliangUnit = value;
                RaisePropertyChanged("YongliangUnit");
            }
        }
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime InputTime
        {
            get
            {
                return inputTime;
            }

            set
            {
                inputTime = value;
                RaisePropertyChanged("InputTime");
            }
        }

        public ObjectId Id
        {
            get
            {
                return _id;
            }

            set
            {
                _id = value;

                RaisePropertyChanged("Id");
            }
        }

        public string TakeAmount
        {
            get
            {
                return takeAmount;
            }

            set
            {
                takeAmount = value;
                RaisePropertyChanged("TakeAmount");
            }
        }
    }
}